﻿using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace qlvt
{
    class HoaDonDAL
    {
        public HoaDonDAL()
        {

        }
        public void ThemHoaDon(string sohd, string mahang,double soluong, double dongia, double trigia, double khuyenmai, string diengiai)
        {
            SqlConnection conn = new SqlConnection();
            conn.ConnectionString = "Data Source=(local);Initial Catalog=qlvt; User Id=sa; Password=sa";
            conn.Open();
            SqlCommand cmd = new SqlCommand("insert into HoaDon values ('" + sohd + "', '" + mahang + "','" + soluong.ToString() + "','" + dongia.ToString() + "','" + trigia.ToString() + "','" + khuyenmai.ToString() + "','" + diengiai + "')", conn);   
            cmd.ExecuteNonQuery();
        }

    }
}
